package com.snail;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author snail
 */
@SpringBootApplication
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@ComponentScan
@MapperScan(basePackages = "com.snail")
public class KnifeApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext run = SpringApplication.run(KnifeApplication.class, args);
		ServerProperties bean = run.getBean(ServerProperties.class);
		String contextPath = bean.getServlet().getContextPath();
		Integer port = bean.getPort();
		System.out.println("==================>run at http://localhost:"+ port + contextPath +"/doc.html <==================");
	}

}
